# -*- coding: utf-8 -*-
# filename: handle.py
import hashlib
import reply
import receive
import web
class Handle(object):
    def POST(self):
        try:
            webData = web.data()
            print "Handle Post webdata is ", webData
   #后台打日志
            recMsg = receive.parse_xml(webData)
            if isinstance(recMsg, receive.Msg) and recMsg.MsgType == 'text':
                toUser = recMsg.FromUserName
                fromUser = recMsg.ToUserName
				#被动回复
				if recMsg.Content = "疾速追杀":
					content = "链接：https://pan.baidu.com/s/14i9Z90pVUIBN78ZGNZPIBw 提取码：z8xr"
				elif recMsg.Content = "鬼入侵":
					content = "链接：https://pan.baidu.com/s/1pRk5tyNKUwPJQRIkD4l-vA 提取码：fshh"
				elif recMsg.Content = "狂暴巨兽":
					content = "链接：https://pan.baidu.com/s/1q5dMxQBtsr_dXRumGkjDSw 提取码：6lks"
				elif recMsg.Content = "灿烂的遗产":
					content = "链接：https://pan.baidu.com/s/1pbaz-Y6oqaONxd8Y7W1b9w 提取码：sn9h"
				elif recMsg.Content = "寻梦环游记":
					content = "链接：https://pan.baidu.com/s/1Xxt8ZsIRgJuFswhDYG5sBw 提取码：vvh1 "
				else:
					content = "sorry, 目前还没有收录。点击下方的 我要反馈 ,告诉我们您想看的剧吧！我们将尽快上架资源"
                replyMsg = reply.TextMsg(toUser, fromUser, content)
                return replyMsg.send()
            else:
                print "暂且不处理"
                return "success"
        except Exception, Argment:
            return Argment